import axios from "./axios";

export interface ResType<T> {
  code: string;
  msg: T;
}

type Res<T> = Promise<ItypeAPI<T>>;
// 一般情况下响应数据返回的这三个参数，
// 但不排除后端返回其它的可能性，
interface ItypeAPI<T> {
  msg: T; // 返回状态码的信息，如请求成功等
  code: number; //返回后端自定义的200，404，500这种状态码
}

// 首页轮播图
export const indexCarousel = (data: any): Res<any> => {
  return axios.post("index/carousel", data);
};
//查询条件数据
export const indexClassify = (data: any): Res<any> => {
  return axios.post("index/classify", data);
};
//职业类别数据
export const getJobClassify = (data: any): Res<any> => {
  return axios.post("home/getJobClassify", data);
};
//首页方案列表
export const Index = (data: any): Res<any> => {
  return axios.post("index/index", data);
};
//个人数据
export const indexUser = (data: any): Res<any> => {
  return axios.post("index/user", data);
};
//首页公告数据
export const indexGetIndexNotice = (data: any): Res<any> => {
  return axios.post("index/getIndexNotice", data);
};
//公告列表数据
export const indexGetNotice = (data: any): Res<any> => {
  return axios.post("index/getNotice", data);
};
//公告详情
export const indexGetNoticeDetail = (data: any): Res<any> => {
  return axios.post("index/getNoticeDetail", data);
};
//登录接口
export const login = (data: any): Res<any> => {
  return axios.post("login/pwdLogin", data);
};
//获取投保页面信息
export const getInsureInfo = (data: any): Res<any> => {
  return axios.post("home/getInsureInfo", data);
};
//保单提交接口
export const addOrder = (data: any): Res<any> => {
  return axios.post("home/addOrder", data);
};
//获取施工详细地址
export const homeGetAddress = (data: any): Res<any> => {
  return axios.post("home/getAddress", data);
};
//保单列表
export const orderIndex = (data: any): Res<any> => {
  return axios.post("order/index", data);
};
//供应商数据
export const orderGetQueryData = (data: any): Res<any> => {
  return axios.post("order/getQueryData", data);
};
//退出登录
export const outLogin = (data: any): Res<any> => {
  return axios.post("login/outLogin", data);
};
//保单详情
export const orderDetail = (data: any): Res<any> => {
  return axios.post("order/orderDetail", data);
};
//模板导入
export const uploadUser = (data: any): Res<any> => {
  return axios.post("upload/uploadUser", data);
};
//获取保费
export const getPrice = (data: any): Res<any> => {
  return axios.post("home/getPrice", data);
};
//修改密码
export const setPwd = (data: any): Res<any> => {
  return axios.post("home/setPwd", data);
};
//订单删除
export const orderDel = (data: any): Res<any> => {
  return axios.post("order/orderDel", data);
};
//去支付
export const submitApi = (data: any): Res<any> => {
  return axios.post("home/submitApi", data);
};
//获取电子保单
export const getBd = (data: any): Res<any> => {
  return axios.post("order/getBd", data);
};
//开发票
export const getInvoice = (data: any): Res<any> => {
  return axios.post("order/getInvoice", data);
};
//开专票
export const applyInvoice = (data: any): Res<any> => {
  return axios.post("order/applyInvoice", data);
};
//远程搜索返回数组数据
export const getBusiness = (data: any): Res<any> => {
  return axios.post("home/getBusiness", data);
};
//远程搜索返回单一数据
export const getBusinessInfo = (data: any): Res<any> => {
  return axios.post("home/getBusinessInfo", data);
};
//导出
export const downloadOrder = (data: any): Res<any> => {
  return axios.post("Download/downloadOrder", data);
};
//省市区地址
export const getArea = (data: any): Res<any> => {
  return axios.post("index/getArea", data);
};
//我的业绩数据统计和订单数据
export const achievement = (data: any): Res<any> => {
  return axios.post("order/orderList", data);
};
//我的业绩总佣金
export const achieve = (data: any): Res<any> => {
  return axios.post("order/achieve", data);
};
//批改特约
export const specialclause = (data: any): Res<any> => {
  return axios.post("batch/update_specialclause", data);
};
//获取标的要素
export const getProjectinfo = (data: any): Res<any> => {
  return axios.post("batch/getProjectinfo", data);
};
//批改工程信息
export const updateProjectinfo = (data: any): Res<any> => {
  return axios.post("batch/update_projectinfo", data);
};
//批改被保人列表
export const insuredList = (data: any): Res<any> => {
  return axios.post("batch/getDeleteInsured", data);
};
//批减被保人
export const insuredDelete = (data: any): Res<any> => {
  return axios.post("batch/delete_insure", data);
};
//单笔订单批改记录
export const pdIndex = (data: any): Res<any> => {
  return axios.post("batch/index", data);
};
//批单查询
export const pdList = (data: any): Res<any> => {
  return axios.post("batch/list", data);
};
//批改地址信息
export const updateAddress = (data: any): Res<any> => {
  return axios.post("batch/update_address", data);
};
//批单录入列表
export const pdOrderList = (data: any): Res<any> => {
  return axios.post("batch/orderList", data);
};
//批改被保人
export const pdInsured = (data: any): Res<any> => {
  return axios.post("batch/update_insuredB", data);
};
//获取投保人信息
export const getInsure = (data: any): Res<any> => {
  return axios.post("batch/getInsure", data);
};
//批改投保人
export const pdInsure = (data: any): Res<any> => {
  return axios.post("batch/update_insuredT", data);
};
//批增被保人
export const addInsuredB = (data: any): Res<any> => {
  return axios.post("batch/add_insuredB", data);
};
//批改详情
export const pdGetInfo = (data: any): Res<any> => {
  return axios.post("batch/getInfo", data);
};
//验证登录
export const checkLogin = (data: any): Res<any> => {
  return axios.post("login/checkLogin", data);
};
//获取天数
export const getEndTime = (data: any): Res<any> => {
  return axios.post("home/getEndTime", data);
};
//撤单
export const cancelDadi = (data: any): Res<any> => {
  return axios.post("home/cancelDadi", data);
};
//播放留痕
export const getMark = (data: any): Res<any> => {
  return axios.post("login/getMark", data);
};
//广福支付
export const gfpay = (data: any): Res<any> => {
  return axios.post("home/gfpay", data);
};
//线下打款提交
export const imgPay = (data: any): Res<any> => {
  return axios.post("order/imgPay", data);
};
//紫金对公支付请求数据
export const corpPayment = (data: any): Res<any> => {
  return axios.post("home/corpPayment", data);
};
//对公支付保存
export const corpFile = (data: any): Res<any> => {
  return axios.post("home/corpFile", data);
};